﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Heightmap_Editor.Menu.Screens
{
    class MenuProgressBar : MenuWidget
    {
        private float _progress = 0;

        public float Progress
        {
            get { return _progress; }
            set { _progress = value; }
        }

        public MenuProgressBar(float progress)
            : base("0%")
        {
            _progress = progress;
        }

        public override void Update(MenuScreen screen, Microsoft.Xna.Framework.GameTime gameTime)
        {
            Text = _progress.ToString("0") + "%\n";

            for (int i = 0; i < _progress; i += 4)
            {
                Text += "|";
            }

            base.Update(screen, gameTime);
        }

        public override int GetHeight(MenuScreen screen)
        {
            return 2 * base.GetHeight(screen);
        }
    }
}
